package com.tdd;

import java.math.BigDecimal;

import org.junit.Test;

public class CompositeOperationTest {
	@Test
	public void addThenMultiply() throws Exception {
		CompositeOperation op = new CompositeOperation();
		op.add(new Plus());
		op.add(new Multiply());
		
		HpStack stack = new HpStack();
		stack.push(new BigDecimal(3));
		stack.push(new BigDecimal(4));
		stack.push(new BigDecimal(11));
		
		op.operate(stack);
		
		assertEquals(45, stack.peek());
	}
}
